package com.cw.base.jeeyc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cw.base.common.model.dto.response.CommonRespDto;
import com.cw.base.jeeyc.biz.intf.DeployDictItemBiz;
import com.cw.base.jeeyc.deploy.dto.DeployDictItemDto;
import com.cw.base.jeeyc.deploy.intf.DeployDictItemApi;

/**
 * 数据字典项接口层
 *
 * @author chenw
 * @date 2019-08-26 21:21:57
 */
@RestController
@RequestMapping("/v1/deployDictItem")
public class DeployDictItemApiImpl implements DeployDictItemApi {
    @Autowired
    private DeployDictItemBiz deployDictItemBiz;
    /**
     * 新增数据字典项
     *
     * @param request 条件
     * @return boolean
     */
    @Override
    public CommonRespDto<String> addDeployDictItem(@RequestBody DeployDictItemDto request) {
        return CommonRespDto.<String>builder().data(
            deployDictItemBiz.addDeployDictItem(request)).build();
    }

    /**
     * 更新数据字典项
     *
     * @param request 条件
     * @return String
     */
    @Override
    public CommonRespDto<Boolean> modifyDeployDictItem(@RequestBody DeployDictItemDto request) {
        return CommonRespDto.<Boolean>builder().data(
            deployDictItemBiz.modifyDeployDictItem(request)).build();
    }

    /**
     * 删除数据字典项
     *
     * @param request 条件
     * @return boolean
     */
    @Override
    public CommonRespDto<Boolean> deleteDeployDictItem(@RequestBody DeployDictItemDto request) {
        return CommonRespDto.<Boolean>builder().data(deployDictItemBiz.deleteDeployDictItem(request)).build();
    }
}
